#include<vector>
using namespace std;
class Solution {
public:
    vector<int> missingTwo(vector<int>& nums) {
        int ans = 0;
        for (int i = 1; i < nums.size() + 3; ++i)
            ans ^= i;
        for (int i = 0; i < nums.size(); ++i)
            ans ^= nums[i];
        int first = 0;
        int diff = ans & (-ans);
        for (int i = 1; i < nums.size() + 3; ++i)
            if (diff & i) first ^= i;
        for (int i = 0; i < nums.size(); ++i)
            if (diff & nums[i]) first ^= nums[i];
        return { first,first ^ ans };
    }
};

int main() {
    Solution sol;
    vector<int>nums = { 1 };
    sol.missingTwo(nums);

}